/**
 * 加载图片
 * @param path 图片路径
 * @param dom 展示图片的dom元素
 */
const loadImg = (path, dom) => {
    let options = {
        method: 'POST',
        headers: {
            'Content-Type': 'application/json',
        },
        body: JSON.stringify({
            path: path
        })
    }
    fetch('http://localhost:4000/getImgSrc', options)
        .then(res => res.text())
        .then(res => {
            dom.src = res
        })
}
export default loadImg;
